//
//	Controller.m
//	IconView
//
//	Created by David Thorpe on 03/12/2007.
//	Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "FontIconCollectionController.h"

@implementation FontIconCollectionController

@synthesize selectedIndexes = m_theSelectedIndexes;

-(id)init {
	//NSLog(@"GSFontIconCollectionController.init");

	self = [super init];
	if (self != nil) {
	}
	return self;
}

-(void)dealloc {
	NSLog(@"GSFontIconCollectionController.dealloc");
	[m_theSelectedIndexes release];
	[super dealloc];
}

-(FontIconCollectionView* )ibCollectionView {
	NSParameterAssert(m_ibCollectionView);
	return m_ibCollectionView;
}

////////////////////////////////////////////////////////////////////////////////

-(void)awakeFromNib {
	NSUserDefaults *Defaults = [NSUserDefaults standardUserDefaults];
	//[[self ibCollectionView] setSubviewSize: [[Defaults objectForKey:@"FontIconCollectionSize"] floatValue]];
	
}

////////////////////////////////////////////////////////////////////////////////

-(IBAction)doubleClick:(id)sender {
	if([[self selectedIndexes] count] > 1) {
		// do nothing for multiple select
		return;
	}
}

-(IBAction)setIconSize:(id)sender {
	CGFloat theSize = [sender floatValue];
	NSUserDefaults *Defaults = [NSUserDefaults standardUserDefaults];
	[Defaults setObject:[NSNumber numberWithFloat:theSize] forKey:@"FontIconCollectionSize"];
	[[self ibCollectionView] setSubviewSize:theSize];
}
@end
